package com.pangu.bean;

/**
 * 分页信息
 * <p/>
 * Created by cxlin
 */
public class PageInfo {

	private int from;
	// 每页的大小(默认)
	private int size = 20;
	private int totalCount;

	public int getFrom() {
		return from;
	}

	public void setFrom(int from) {
		this.from = from;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	/**
	 * 获得下一页的所有<br>
	 * 请求列表的时候必须调用这个方法
	 * 
	 * @return
	 */
	public int getNextFrom() {
		return totalCount == 0 ? from : (from + size);
	}

}
